package com.antgroup.seckill.business.goods.service.impl;

import com.antgroup.seckill.business.goods.mapper.SeckillGoodsMapper;
import com.antgroup.seckill.business.goods.model.SeckillGoods;
import com.antgroup.seckill.business.goods.model.User;
import com.antgroup.seckill.business.goods.service.ISeckillGoodsService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.QueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wangxy
 * @since 2024-07-30
 */
@Service
public class SeckillGoodsServiceImpl extends ServiceImpl<SeckillGoodsMapper, SeckillGoods> implements ISeckillGoodsService {

    @Autowired
    private SeckillGoodsMapper seckillGoodsMapper;
    
    @Override
    public SeckillGoods querySeckillGoodsByGoodsId(String goodsId) {

        QueryWrapper<SeckillGoods> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("goods_id", goodsId);

        SeckillGoods seckillGoods = seckillGoodsMapper.selectOne(queryWrapper);
        return seckillGoods;
    }
}
